package ace.cmp.core.exception;

import ace.cmp.core.enums.SystemCodeEnum;
import lombok.Getter;

/**
 * @author Caspar 业务异常
 */
public class BusinessI18nException extends BusinessException {

  @Getter private Object[] args = null;
  @Getter private String defaultMessage = "系统异常";
  @Getter private String i18nCode = "ace.cmp.core.exception.system-exception";

  public BusinessI18nException() {}

  public BusinessI18nException(
      Integer code, String i18nCode, Object[] args, String defaultMessage, Throwable throwable) {
    super(code, defaultMessage, throwable);
    this.i18nCode = i18nCode;
    this.args = args;
    this.defaultMessage = defaultMessage;
  }

  public BusinessI18nException(Integer code, String i18nCode, String defaultMessage) {
    super(code, defaultMessage);
    this.i18nCode = i18nCode;
    this.defaultMessage = defaultMessage;
  }

  public BusinessI18nException(
      String i18nCode, Object[] args, String defaultMessage, Throwable throwable) {
    super(SystemCodeEnum.BUSINESS_EXCEPTION.getCode(), defaultMessage, throwable);
    this.i18nCode = i18nCode;
    this.args = args;
    this.defaultMessage = defaultMessage;
  }

  public BusinessI18nException(String i18nCode, Object[] args, String defaultMessage) {
    super(SystemCodeEnum.BUSINESS_EXCEPTION.getCode(), defaultMessage);
    this.i18nCode = i18nCode;
    this.args = args;
    this.defaultMessage = defaultMessage;
  }

  public BusinessI18nException(String i18nCode, String defaultMessage) {
    super(SystemCodeEnum.BUSINESS_EXCEPTION.getCode(), defaultMessage);
    this.i18nCode = i18nCode;
    this.defaultMessage = defaultMessage;
  }
}
